﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ImageProcessing.IntermediateClasses;

namespace ImageProcessing.DataEntryDialogs
{
    public partial class FrequencyFilterDialog : Form
    {
        private Dimentions dim;
        private bool butterworth;
        public FrequencyFilterDialog(ref Dimentions d, bool butterworth)
        {
            InitializeComponent();
            this.butterworth = butterworth;
            if (!butterworth)
            {
                this.txtButterworthN.Visible = false;
                this.lblN.Visible = false;
            }
            this.dim = d;
        }

        private void btnFilter_Click(object sender, EventArgs e)
        {
            try
            {
                dim.DoubleValue = double.Parse(this.txtDistance.Text);
                if (butterworth)
                {
                    dim.Value = int.Parse(this.txtButterworthN.Text);
                }
                this.Close();
            }
            catch
            {
                MessageBox.Show("Please review entered data.");
            }
        }
    }
}
